package com.shenzhen.horselive.utils;

import android.content.Context;
import android.view.View;

import androidx.constraintlayout.widget.ConstraintLayout;

import com.shenzhen.horselive.beans.UserAcountBean;
import com.shenzhen.horselive.databinding.DialogCancelYuyueBinding;
import com.shenzhen.horselive.ui.dialog.CommentDialog;
import com.shenzhen.horselive.ui.dialog.CommentOneButtonDialog;
import com.shenzhen.horselive.ui.dialog.DialogCaneclApply;
import com.shenzhen.horselive.ui.dialog.DialogPayways;
import com.shenzhen.horselive.ui.dialog.InputDialog;
import com.shenzhen.horselive.ui.dialog.UpdateDialog;
import com.shenzhen.horselive.widget.VerificationCodeInput;
import com.shenzhen.horselive.widget.actionsheet.ActionSheet;

public class DialogManager {
    private  static  DialogManager  manager;
    private DialogManager() {
    }
    public static DialogManager getInstance() {
        if (manager==null)
        {
            manager = new DialogManager();
        }
        return manager ;
    }


    public void  showCommentDialog(Context  context,String  title,String  content)
    {
        CommentOneButtonDialog commentDialog =  new CommentOneButtonDialog(context);
        commentDialog.setTitleText(title);
        commentDialog.setContent(content);
        commentDialog.show();
        commentDialog.setConfirm(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                commentDialog.dismiss();
            }
        });

    }



    public void  showCommentDialog(Context  context, String  title, String  content, CommentOneButtonDialog.OneButtonClickListener onClickListener)
    {
        CommentOneButtonDialog commentDialog =  new CommentOneButtonDialog(context);
        commentDialog.setTitleText(title);
        commentDialog.setContent(content);
        commentDialog.show();
        commentDialog.setListener(onClickListener);
    }


    /**
     * 两个按钮的弹窗
     * @param context
     * @param title
     * @param content
     */
    public void  showCommentDialog(Context  context, String  title, String  content, CommentDialog.OnClickButton  onClickButton)
    {
        CommentDialog commentDialog =  new CommentDialog(context);
        commentDialog.setTitleText(title);
        commentDialog.setContent(content);
        commentDialog.setOnClickButton(onClickButton);
        commentDialog.show();

    }



/**
 * 密码输入框
 *
 */

public  void   showInputDialog(Context context, String  title, String  content, InputDialog.OnInputFinsh listener)
{
    InputDialog  inputDialog = new InputDialog(context);
    inputDialog.setTextName(title);
    inputDialog.setTextContent(content);
    inputDialog.setOnInputFinsh(listener);
    inputDialog.show();
}


    /**
     * 选择支付方式
     * @param context
     * @param onButtonClick
     */
public void  showPayWaysDialog(Context  context,String money, DialogPayways.OnButtonClick  onButtonClick)
{
    DialogPayways   dialogPayways = new DialogPayways(context);
    dialogPayways.setMoney(money);
    dialogPayways.setOnButtonClick(onButtonClick);
    dialogPayways.show();
}


    /**
     * 取消开卡申请
     * @param context
     * @param money
     * @param dataBean
     * @param onButtonClick
     */
   public void  showCancelApply(Context  context, String  money, UserAcountBean.DataBean  dataBean, DialogCaneclApply.OnButtonClick onButtonClick)
   {
       DialogCaneclApply   dialogCaneclApply = new DialogCaneclApply(context);
       dialogCaneclApply.setData(money, dataBean);
       dialogCaneclApply.setOnButtonClick(onButtonClick);
       dialogCaneclApply.show();
   }

    /**
     *
     * @param context
     * @param versionname
     * @param notice
     * @param onUpdateClick
     * @param isFocuse 是否强制更新
     */

   public  void   showUpdateDialog(Context  context, String versionname,String notice, UpdateDialog.OnUpdateClick  onUpdateClick,boolean  isFocuse)
   {
       UpdateDialog  dialog = new UpdateDialog(context);
       dialog.setData(versionname,notice);
       dialog.setOnUpdateClick(onUpdateClick);
       dialog.setFouce(isFocuse);
       dialog.show();
   }





}
